import java.util.Scanner;

/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: While2.java
 * @Time: 2022/12/3 8:42
 * @Author: abcque
 * @Description: 渔夫打渔筛网问题
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class While2 {
    public static void main(String[] args) {
        // step1、通过键盘输入年、月、日。保存到 year、month、day 中
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = scanner.nextInt();
        System.out.println("请输入月份");
        int month = scanner.nextInt();
        System.out.println("请输入日期");
        int day = scanner.nextInt();

        // step2、计算输入的日期距离当年的天数
        // 1) 判断是否为闰年
        boolean leapYear = true;
        if ((year % 100 == 0 && year % 400 == 0) || (year % 100 != 0 && year % 4 == 0)) {
            leapYear = false;
        }

        int days = 0;
        // 2) 计算距离当年 1 月 1 日的天数
        switch (month - 1) {
            case 11:
                days += 30;
            case 10:
                days += 31;
            case 9:
                days += 30;
            case 8:
                days += 31;
            case 7:
                days += 31;
            case 6:
                days += 30;
            case 5:
                days += 31;
            case 4:
                days += 30;
            case 3:
                days = days + 31;
            case 2:
                if (leapYear) {
                    days = days + 28;
                } else {
                    days = days + 29;
                }
            case 1:
                days = days + 31;
            case 0:
                days += 0;

        }

        days = days + day;

        System.out.println(year + " 年 " + month + " 月 " + day + " 是第 " + days + " 天");
        // step3、判断打渔还是晒网

        while (days > 5) {
            days -= 5;
        }
        System.out.println(days);
        if (1 <= days && days <= 3) {
            System.out.println("渔夫在打渔");
        } else {
            System.out.println("渔夫在晒网");
        }
    }
}
